import { createRef } from "react";
import { Outlet, Navigate } from "react-router-dom";
import { SuspenseComponent } from "@/utils/MyFun";

const settion = {
  name: "系统管理",
  path: "/setting",
  element: <Outlet />,
  nodeRef: createRef(null),
  isHidden: false,
  meta: {
    title: "系统管理",
    icon: "ion:md-settings",
    order: 5,
    keepAlive: true,
    // role: ['admin'],
    // requireAuth: true,
  },
  children: [
    {
      path: "/setting",
      element: <Navigate to="/setting/website" />,
      nodeRef: createRef(null),
      redirect: true,
    },
    {
      name: "网站管理",
      path: "website",
      element: SuspenseComponent("/setting/website"),
      nodeRef: createRef(null),
      isHidden: false,
      meta: {
        title: "网站管理",
        icon: "el:website",
        order: 1,
        keepAlive: true,
      },
    },
    {
      name: "页面管理",
      path: "page",
      element: SuspenseComponent("/setting/page"),
      nodeRef: createRef(null),
      isHidden: false,
      meta: {
        title: "页面管理",
        icon: "iconoir:journal-page",
        order: 2,
        keepAlive: true,
      },
    },
    {
      name: "友链管理",
      path: "link",
      element: SuspenseComponent("/setting/link"),
      nodeRef: createRef(null),
      isHidden: false,
      meta: {
        title: "友链管理",
        icon: "mdi:telegram",
        order: 3,
        keepAlive: true,
      },
    },
    {
      name: "关于我",
      path: "about",
      element: SuspenseComponent("/setting/about"),
      nodeRef: createRef(null),
      isHidden: false,
      meta: {
        title: "关于我",
        icon: "cib:about-me",
        order: 4,
        keepAlive: true,
      },
    },
  ],
};

export default settion;
